home *** CD-ROM | disk | FTP | other *** search
-
- #ifndef __dl_coord_h
- #define __dl_coord_h
- #ifndef __dl_core_h
- #include "Core.h"
- #endif
- #ifndef __dl_wimp_h
- #include "Wimp.h"
- #endif
- typedef struct
- {
- wimp_rect screenrect;
- wimp_point scroll;
- } convert_block;
-
- extern BOOL Coord_PointInRect(wimp_point *, wimp_rect *);
- extern BOOL Coord_RectContained(wimp_rect *, wimp_rect *);
- extern BOOL Coord_RectsOverlap(wimp_rect *, wimp_rect *);
- #define Coord_RectsIntersect(r1, r2) (Coord_RectsOverlap(r1, r2) && \
- !Coord_RectContained(r1, r2) && \
- !Coord_RectContained(r2, r1))
- extern void Coord_WindowOrigin(wimp_point *origin, convert_block *convert);
- #define Coord_XToScreen(X, C) (((X) - (C)->scroll.x) + (C)->screenrect.min.x)
- #define Coord_YToScreen(Y, C) ( ((Y) - (C)->scroll.y) + (C)->screenrect.max.y )
- extern void Coord_PointToScreen(wimp_point *point, convert_block *convert);
- extern void Coord_RectToScreen(wimp_rect *rect, convert_block *convert);
- #define Coord_XToWorkArea(X, C) (((X)-(C)->screenrect.min.x)+(C)->scroll.x)
- #define Coord_YToWorkArea(Y, C) (((Y)-(C)->screenrect.max.y)+(C)->scroll.y)
- extern void Coord_PointToWorkArea(wimp_point *point, convert_block *convert);
- extern void Coord_RectToWorkArea(wimp_rect *rect, convert_block *convert);
- #endif
-